<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>营业收入</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Finance/systurnover_list')}">
        用户姓名：<input type="text" name="user_name" style="width: 100px;" value="{$formget.user_name}">
        跑客姓名：<input type="text" name="dispatch_name" style="width: 100px;" value="{$formget.dispatch_name}">
        订单号：<input type="text" name="order_number" style="width: 100px;" value="{$formget.order_number}">
        订单时间：
        <input type="text" name="start_time" class="js-date" value="{$formget.start_time|default=''}" style="width: 90px;" autocomplete="off">-
        <input type="text" class="js-date" name="end_time" value="{$formget.end_time}" style="width: 90px;" autocomplete="off"> &nbsp; &nbsp;
        &nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索" />
    </form>
    <form method="post" class="js-ajax-form">
       <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th align="center">序号</th>
                <th>用户姓名</th>
                <th>跑客姓名</th>
                <th>订单号</th>
                <th>订单时间</th>
                <th>订单金额</th>
                <th>优惠券</th>
                <th>优惠金额</th>
                <th>订单实收</th>
                <th>支付跑客</th>
                <th>支付分成</th>
                <th>支付推荐</th>
                <th>收入类型</th>
                <th>账面应收</th>
                <th>账面实收</th>
                <th>实际收入</th>
                <th align="center">操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="datas" item="vo" key="k">
                <tr><php>$recommend_amount = getRecommendPn($vo[orderid],$vo[dispatch_id]);
                          $recommend_separate = $vo[total_income]-$vo[separate_income];
                          $income_types = array('1'=>'佣金收入','2'=>'用户罚金','3'=>'跑客罚金');
                    </php>
                    <td align="center">{$k+1}</td>
                    <td>{$vo.user_name}</td>
                    <td>{$vo.dispatch_name}</td>
                    <td>{$vo[order_number]}</td>
                    <td>{$vo.time}</td>
                    <td>{$vo[ordermoney]}</td>
                    <td>{$vo[uid]|getCouponValue=$vo[orderid],###}</td>
                    <td>{$vo[uid]|getOrderCoupon=$vo[orderid],###}</td>
                    <td>{$vo[real_amount]}</td><!--  订单实收==用户实付订单金额  -->
                    <td>{$vo[dispatch_get_money]}</td><!--  支付跑客==跑腿费  -->
                    <td>{$vo[recommend_separate]}</td><!--  支付分成=账面应收-账面实收  -->
                    <td>{$recommend_amount}</td><!--  推荐奖励  -->
                    <td>{$income_types[$vo[income_type]]}</td>
                    <td>{$vo[total_income]}</td>
                    <td>{$vo[separate_income]}</td>
                    <td>
                    <if condition="$vo[income_type] eq 1">
                       {$vo[real_amount]-$vo[dispatch_get_money]-$recommend_separate-$recommend_amount}<!--  实际收入=收入-支出    -->
                        <else/>
                        {$vo[total_income]}
                    </if>
                        </td>
                    <td align="center">
                        <if condition="$vo[income_type] eq 1">
                        <a href="{:U('Finance/systurnover_see',array('id'=>empty($vo['id'])?'':$vo['id']))}">收入明细</a>
                        </if>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <if condition="empty($datas)">
        <div style="padding: 30px;text-align: center;color: #999999">
            <i class="fa fa-database" style="font-size: 38px"></i><br />
            暂无数据
        </div>
        </if>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>

</body>
</html>